============ MP3 Commands ============ Sending Commands to the MP3 player ---------------------------------- Define const arrays to hold the sequence of bytes for each command you want to use. See :ref:`VS1002` for more details on the available commands. .. code-block:: c const INT8U SineWave[] = { 0x53, 0xEF, 0x6E, 0x44, 0x00, 0x00, 0x00, 0x00 }; const INT8U Deact[] = { 0x45, 0x78, 0x69, 0x74, 0x00, 0x00, 0x00, 0x00 }; const INT8U ModeTest[] = { 0x02, 0x00, 0x08, 0x20 }; const INT8U ModePlay[] = { 0x02, 0x00, 0x08, 0x00 }; const INT8U SoftReset[] = { 0x02, 0x00, 0x08, 0x04 }; Call the commands using the write function of the driver. Set to command mode. .. code-block:: c DataMode = 0; length = sizeof(DataMode); err = Ioctl(hMp3, IOCTL_MP3_SET_DATA_MODE, &DataMode, &length); Reset player. .. code-block:: c //reset the MP3 chip length = sizeof(SoftReset); memcpy(buffer, SoftReset, length); err = Write(hMp3, buffer, &length); Play sine wave. .. code-block:: c length = sizeof(SineWave); memcpy(buffer, SineWave, length); err = Write(hMp3, buffer, &length); Stop player. .. code-block:: c length = sizeof(Deact); memcpy(buffer, Deact, length); err = Write(hMp3, buffer, &length);